﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:System="clr-namespace:System;assembly=mscorlib"
                    xmlns:System_Windows_Controls_Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
                    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                    xmlns:cusControls="clr-namespace:Corina.Controls.Silverlight;assembly=Corina.Controls.Silverlight"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    mc:Ignorable="d">

    <!--  Global Settings  -->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
        <ResourceDictionary Source="Fonts.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--  *******CONTROLS STYLES******  -->
    <!--  ****************************  -->

    <!--  ValidationToolTipTemplate Style  -->
    <ControlTemplate x:Key="ValidationToolTipTemplate">
        <Grid x:Name="Root"
              Margin="5,0"
              Opacity="0"
              RenderTransformOrigin="0,0">
            <Grid.RenderTransform>
                <TranslateTransform x:Name="xform" X="-25" />
            </Grid.RenderTransform>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="OpenStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0" />
                        <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                                    <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                                    <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                                <SplineDoubleKeyFrame KeyTime="0" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Open">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
                                <SplineDoubleKeyFrame KeyTime="0" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                                <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Margin="4,4,-4,-4"
                    Background="{StaticResource ValidationBrush1}"
                    CornerRadius="5" />
            <Border Margin="3,3,-3,-3"
                    Background="{StaticResource ValidationBrush2}"
                    CornerRadius="4" />
            <Border Margin="2,2,-2,-2"
                    Background="{StaticResource ValidationBrush3}"
                    CornerRadius="3" />
            <Border Margin="1,1,-1,-1"
                    Background="{StaticResource ValidationBrush4}"
                    CornerRadius="2" />
            <Border Background="{StaticResource ValidationBrush5}" CornerRadius="2" />
            <Border CornerRadius="2">
                <TextBlock MaxWidth="250"
                           Margin="8,4,8,4"
                           Foreground="{StaticResource WhiteColorBrush}"
                           Text="{Binding (Validation.Errors)[0].ErrorContent}"
                           TextWrapping="Wrap"
                           UseLayoutRounding="false" />
            </Border>
        </Grid>
    </ControlTemplate>

    <!--  CommonValidationToolTipTemplate Style  -->
    <ControlTemplate x:Key="CommonValidationToolTipTemplate" TargetType="ToolTip">
        <Grid x:Name="Root"
              Margin="5,0"
              Opacity="0"
              RenderTransformOrigin="0,0">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="OpenStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0" />
                        <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
                            <Storyboard>
                                <DoubleAnimation Duration="0:0:0.2"
                                                 Storyboard.TargetName="Translation"
                                                 Storyboard.TargetProperty="X"
                                                 To="0">
                                    <DoubleAnimation.EasingFunction>
                                        <BackEase Amplitude=".3" EasingMode="EaseOut" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                                <DoubleAnimation Duration="0:0:0.2"
                                                 Storyboard.TargetName="Root"
                                                 Storyboard.TargetProperty="Opacity"
                                                 To="1" />
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="Root"
                                             Storyboard.TargetProperty="Opacity"
                                             To="0" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Open">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="Translation"
                                             Storyboard.TargetProperty="X"
                                             To="0" />
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="Root"
                                             Storyboard.TargetProperty="Opacity"
                                             To="1" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.RenderTransform>
                <TranslateTransform x:Name="Translation" X="-25" />
            </Grid.RenderTransform>
            <Border Margin="4,4,-4,-4"
                    Background="{StaticResource ValidationBrush1}"
                    CornerRadius="5" />
            <Border Margin="3,3,-3,-3"
                    Background="{StaticResource ValidationBrush2}"
                    CornerRadius="4" />
            <Border Margin="2,2,-2,-2"
                    Background="{StaticResource ValidationBrush3}"
                    CornerRadius="3" />
            <Border Margin="1,1,-1,-1"
                    Background="{StaticResource ValidationBrush4}"
                    CornerRadius="2" />
            <Border Background="{StaticResource ValidationBrush5}" CornerRadius="2">
                <TextBlock MaxWidth="250"
                           Margin="8,4,8,4"
                           Foreground="{StaticResource WhiteColorBrush}"
                           Text="{Binding (Validation.Errors)[0].Exception.Message}"
                           TextWrapping="Wrap"
                           UseLayoutRounding="false" />
            </Border>
        </Grid>
    </ControlTemplate>

    <!--  Button Style  -->
    <Style TargetType="Button">
        <Setter Property="Background" Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="Padding" Value="5,6" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.7" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0.3" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource ControlsDisabledBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3" />
                        <Border x:Name="MouseOverBorder"
                                Background="{StaticResource GrayBrush8}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="PressedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Rectangle x:Name="FocusRectangle"
                                   Margin="-1"
                                   Opacity="0"
                                   RadiusX="4"
                                   RadiusY="4"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <ContentPresenter x:Name="contentPresenter"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  SearchButtonStyle  -->
    <Style x:Key="SearchButtonStyle" TargetType="HyperlinkButton">
        <Setter Property="Margin" Value="-22,0,20,0" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid Width="14"
                          Height="16"
                          Margin="3,2,0,0"
                          HorizontalAlignment="Center"
                          VerticalAlignment="Center">
                        <Rectangle Width="4"
                                   Height="8"
                                   Margin="0,0,-0.164,-0.334"
                                   HorizontalAlignment="Right"
                                   VerticalAlignment="Bottom"
                                   Fill="#FF767676"
                                   RadiusX="0.5"
                                   RadiusY="0.5"
                                   RenderTransformOrigin="0.5,0.5"
                                   Stroke="#FF767676"
                                   UseLayoutRounding="False">
                            <Rectangle.RenderTransform>
                                <RotateTransform Angle="-45" />
                            </Rectangle.RenderTransform>
                        </Rectangle>
                        <Ellipse Margin="0,0,1,3"
                                 Fill="Transparent"
                                 Stroke="#FF767676" />
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Grid x:Name="grid"
                          Margin="-6,0,0,-4"
                          Cursor="{TemplateBinding Cursor}">
                        <Grid.Background>
                            <SolidColorBrush Color="{StaticResource BaseColor2}" />
                        </Grid.Background>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="ContentPresenterWrapperColor"
                                                        Storyboard.TargetProperty="(SolidColorBrush.Color)"
                                                        To="{StaticResource HighlightLightColor}"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="grid"
                                                        Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
                                                        To="{StaticResource Gray5}"
                                                        d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="grid"
                                                        Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
                                                        To="{StaticResource Gray5}"
                                                        d:IsOptimized="True" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="grid"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.8"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="DisabledOverlay"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <TextBlock x:Name="UnderlineTextBlock"
                                   Margin="{TemplateBinding Padding}"
                                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                   Text="{TemplateBinding Content}"
                                   TextDecorations="Underline"
                                   Visibility="Collapsed">
                            <TextBlock.Foreground>
                                <SolidColorBrush Color="{StaticResource HighlightDarkColor}" />
                            </TextBlock.Foreground>
                        </TextBlock>
                        <TextBlock x:Name="DisabledOverlay"
                                   Margin="{TemplateBinding Padding}"
                                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                   Canvas.ZIndex="1"
                                   Foreground="{StaticResource DisbaledForegroundBrush}"
                                   Text="{TemplateBinding Content}"
                                   Visibility="Collapsed" />
                        <ContentControl>
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor" Color="{StaticResource HighlightDarkColor}" />
                            </ContentControl.Foreground>
                            <ContentPresenter x:Name="contentPresenter"
                                              Width="21"
                                              Margin="2,3,0,0"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </ContentControl>
                        <Rectangle x:Name="FocusVisualElement"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   StrokeThickness="1">
                            <Rectangle.Stroke>
                                <SolidColorBrush Color="{StaticResource HighlightLightColor}" />
                            </Rectangle.Stroke>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  Control Label Style  -->
    <Style x:Key="ControlLabelStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource LabelTextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource LabelFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
    </Style>

    <!--  HyperlinkButton Style  -->
    <Style TargetType="HyperlinkButton">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource HyperlinkFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="Padding" Value="2,0,2,0" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Grid Background="{TemplateBinding Background}" Cursor="{TemplateBinding Cursor}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="UnderlineTextBlock"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor" Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource HighlightLightColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="UnderlineTextBlock"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="DisabledOverlay"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <TextBlock x:Name="UnderlineTextBlock"
                                   Margin="{TemplateBinding Padding}"
                                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                   Text="{TemplateBinding Content}"
                                   TextDecorations="Underline"
                                   Visibility="Collapsed">
                            <TextBlock.Foreground>
                                <SolidColorBrush Color="{StaticResource HighlightDarkColor}" />
                            </TextBlock.Foreground>
                        </TextBlock>
                        <TextBlock x:Name="DisabledOverlay"
                                   Margin="{TemplateBinding Padding}"
                                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                   Canvas.ZIndex="1"
                                   Foreground="{StaticResource DisbaledForegroundBrush}"
                                   Text="{TemplateBinding Content}"
                                   Visibility="Collapsed" />
                        <ContentControl>
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor" Color="{StaticResource HighlightDarkColor}" />
                            </ContentControl.Foreground>
                            <ContentPresenter x:Name="contentPresenter"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </ContentControl>
                        <Border x:Name="FocusVisualElement"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="false"
                                Opacity="0">
                            <Border.BorderBrush>
                                <SolidColorBrush Color="{StaticResource HighlightLightColor}" />
                            </Border.BorderBrush>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  TextBlock Style  -->
    <Style TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
    </Style>

    <!--  ComboBoxItem Style  -->
    <Style TargetType="ComboBoxItem">
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Background" Value="{StaticResource TransparentWhiteBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="TabNavigation" Value="Local" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBoxItem">
                    <Grid Margin="0,0.5" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value=".65" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor" Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource HoverForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SelectedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor" Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource HoverForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="SelectedRectangle"
                                   Fill="{StaticResource HighlightBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0" />
                        <Rectangle x:Name="MouseOverRectangle"
                                   Fill="{StaticResource HighlightBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0" />
                        <ContentControl>
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor" Color="{StaticResource NormalForegroundColor}" />
                            </ContentControl.Foreground>
                            <ContentPresenter x:Name="contentPresenter"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </ContentControl>
                        <Rectangle x:Name="FocusVisualElement"
                                   RadiusX="1"
                                   RadiusY="1"
                                   Stroke="{StaticResource HighlightBrush}"
                                   StrokeThickness="1"
                                   Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  ComboBox Style  -->
    <Style TargetType="ComboBox">
        <Setter Property="Padding" Value="6,4,25,4" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Gray7}" />
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="TabNavigation" Value="Once" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <Grid.Resources>
                            <Style x:Name="comboToggleStyle" TargetType="ToggleButton">
                                <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
                                <Setter Property="Background" Value="{StaticResource GrayBrush7}" />
                                <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
                                <Setter Property="BorderThickness" Value="1" />
                                <Setter Property="Padding" Value="3" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ToggleButton">
                                            <Grid>
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                    <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                    <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled" />
                                                    </VisualStateGroup>
                                                    <VisualStateGroup x:Name="CheckStates">
                                                        <VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckedInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Unchecked" />
                                                    </VisualStateGroup>
                                                    <VisualStateGroup x:Name="FocusStates">
                                                        <VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                    <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                    <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Unfocused" />
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border x:Name="Background"
                                                        Background="{TemplateBinding Background}"
                                                        BorderBrush="{TemplateBinding BorderBrush}"
                                                        BorderThickness="{TemplateBinding BorderThickness}"
                                                        CornerRadius="3" />
                                                <Rectangle x:Name="DisabledVisualElement"
                                                           Fill="{StaticResource WhiteBrush}"
                                                           IsHitTestVisible="false"
                                                           Opacity="0"
                                                           RadiusX="3"
                                                           RadiusY="3" />
                                                <Border x:Name="MouseOverBorder"
                                                        Background="{StaticResource GrayBrush8}"
                                                        BorderThickness="{TemplateBinding BorderThickness}"
                                                        CornerRadius="3.5"
                                                        Opacity="0" />
                                                <Border x:Name="PressedBorder"
                                                        Background="{StaticResource GrayBrush5}"
                                                        BorderThickness="{TemplateBinding BorderThickness}"
                                                        CornerRadius="3.5"
                                                        Opacity="0" />
                                                <Rectangle x:Name="FocusRectangle"
                                                           Margin="-1"
                                                           Opacity="0"
                                                           RadiusX="4"
                                                           RadiusY="4"
                                                           Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                                                <Rectangle x:Name="FocusInnerRectangle"
                                                           Opacity="0"
                                                           RadiusX="3"
                                                           RadiusY="3"
                                                           Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                                           StrokeThickness="{TemplateBinding BorderThickness}" />
                                                <Rectangle x:Name="CheckedRectangle"
                                                           Opacity="0"
                                                           RadiusX="4"
                                                           RadiusY="4"
                                                           Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                                           StrokeThickness="{TemplateBinding BorderThickness}" />
                                                <Rectangle x:Name="CheckedInnerRectangle"
                                                           Margin="1"
                                                           Opacity="0"
                                                           RadiusX="4"
                                                           RadiusY="4"
                                                           Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                                           StrokeThickness="{TemplateBinding BorderThickness}" />
                                                <ContentPresenter x:Name="contentPresenter"
                                                                  Margin="{TemplateBinding Padding}"
                                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                                  Content="{TemplateBinding Content}"
                                                                  ContentTemplate="{TemplateBinding ContentTemplate}" />
                                                <Rectangle x:Name="FocusVisualElement"
                                                           Margin="1"
                                                           IsHitTestVisible="false"
                                                           RadiusX="3.5"
                                                           RadiusY="3.5"
                                                           Stroke="{StaticResource HighlightBrush}"
                                                           StrokeThickness="1"
                                                           Visibility="Collapsed" />
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.45" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="FocusedDropDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00"
                                                                       Storyboard.TargetName="PopupBorder"
                                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ContentPresenterBorder">
                            <Grid>
                                <ToggleButton x:Name="DropDownToggle"
                                              Margin="0"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch"
                                              HorizontalContentAlignment="Right"
                                              Background="{TemplateBinding Background}"
                                              BorderBrush="{TemplateBinding BorderBrush}"
                                              BorderThickness="{TemplateBinding BorderThickness}"
                                              Style="{StaticResource comboToggleStyle}">
                                    <Path x:Name="BtnArrow"
                                          Width="8"
                                          Height="4"
                                          Margin="0,0,6,0"
                                          HorizontalAlignment="Right"
                                          Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z "
                                          Stretch="Uniform">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="BtnArrowColor" Color="{StaticResource Gray3}" />
                                        </Path.Fill>
                                    </Path>
                                </ToggleButton>
                                <ContentPresenter x:Name="ContentPresenter"
                                                  Margin="{TemplateBinding Padding}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <TextBlock Text=" " />
                                </ContentPresenter>
                            </Grid>
                        </Border>
                        <Rectangle x:Name="FocusRectangle"
                                   Margin="-1"
                                   Opacity="0"
                                   RadiusX="4"
                                   RadiusY="4"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3" />
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="1"
                                CornerRadius="3"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <sys:Boolean>true</sys:Boolean>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Width="12"
                                  Height="12"
                                  Margin="1,-4,-4,0"
                                  HorizontalAlignment="Right"
                                  VerticalAlignment="Top"
                                  Background="Transparent">
                                <Path Margin="1,3,0,0"
                                      Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}" />
                                <Path Margin="1,3,0,0"
                                      Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}" />
                            </Grid>
                        </Border>
                        <Popup x:Name="Popup">
                            <Border x:Name="PopupBorder"
                                    Height="Auto"
                                    HorizontalAlignment="Stretch"
                                    Background="{StaticResource WhiteBrush}"
                                    BorderBrush="{StaticResource ComboBoxPopupBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Effect="{StaticResource DropShadowBrush}">

                                <ScrollViewer x:Name="ScrollViewer"
                                              BorderThickness="0"
                                              Padding="1">
                                    <ItemsPresenter />
                                </ScrollViewer>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
    </Style>

    <!--  PassWordBox Style  -->
    <Style x:Key="PasswordBoxStyle" TargetType="PasswordBox">
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="MinHeight" Value="26" />
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="Foreground">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource TextBoxText}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Padding" Value="2" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="PasswordBox">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="MouseOverBorder"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.8"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="DisabledVisualElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusVisualElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1" />
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusVisualElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Opacity="1">
                            <Border x:Name="ContentElement"
                                    Margin="{TemplateBinding Padding}"
                                    Padding="4,4,4,0" />
                        </Border>
                        <Border x:Name="DisabledVisualElement"
                                Background="{StaticResource DisbaledControlBrush}"
                                BorderBrush="{StaticResource DisbaledControlBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="False"
                                Opacity="0" />
                        <Border x:Name="MouseOverBorder"
                                BorderBrush="{StaticResource TextBoxMouseOverBorderBrush}"
                                BorderThickness="1"
                                Opacity="0" />
                        <Border x:Name="FocusVisualElement"
                                BorderBrush="{StaticResource TextBoxMouseOverBorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="False"
                                Opacity="0">
                            <Rectangle x:Name="FocusInnerRectangle"
                                       Opacity="0"
                                       Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                       StrokeThickness="{TemplateBinding BorderThickness}" />
                        </Border>
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="1"
                                CornerRadius="1"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <sys:Boolean>true</sys:Boolean>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Width="12"
                                  Height="12"
                                  Margin="1,-4,-4,0"
                                  HorizontalAlignment="Right"
                                  VerticalAlignment="Top"
                                  Background="Transparent">
                                <Path Margin="1,3,0,0"
                                      Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}" />
                                <Path Margin="1,3,0,0"
                                      Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  TextBox Style  -->
    <Style TargetType="TextBox">
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="MinHeight" Value="26" />
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusRectangle"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusRectangle"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusInnerRectangle"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="Base"
                                   Fill="{StaticResource ControlBackgroundBrush}"
                                   Opacity="1"
                                   Stroke="{TemplateBinding BorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="FocusRectangle"
                                   Opacity="0"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Margin="1"
                                   Opacity="0"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Grid Margin="0,1,0,0">
                            <Border x:Name="ReadOnlyVisualElement"
                                    Background="{StaticResource ReadOnlyBrush}"
                                    Opacity="0" />
                            <Grid>
                                <ScrollViewer x:Name="ContentElement"
                                              Margin="4,0,2,2"
                                              VerticalAlignment="Center"
                                              Background="{x:Null}"
                                              BorderThickness="0"
                                              IsTabStop="False" />
                            </Grid>
                        </Grid>
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource ControlsDisabledBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   Stroke="{StaticResource ControlsDisabledBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="1"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <sys:Boolean>true</sys:Boolean>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Width="12"
                                  Height="12"
                                  Margin="1,-4,-4,0"
                                  HorizontalAlignment="Right"
                                  VerticalAlignment="Top"
                                  Background="Transparent">
                                <Path Margin="1,3,0,0"
                                      Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}" />
                                <Path Margin="1,3,0,0"
                                      Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  TextBox Style  -->
    <Style TargetType="cusControls:TextBoxExt">
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="MinHeight" Value="26" />
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="cusControls:TextBoxExt">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusRectangle"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusRectangle"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="FocusInnerRectangle"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="Base"
                                   Fill="{StaticResource ControlBackgroundBrush}"
                                   Opacity="1"
                                   Stroke="{TemplateBinding BorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="FocusRectangle"
                                   Opacity="0"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Margin="1"
                                   Opacity="0"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Grid Margin="0,1,0,0">
                            <Border x:Name="ReadOnlyVisualElement"
                                    Background="{StaticResource ReadOnlyBrush}"
                                    Opacity="0" />
                            <Grid>
                                <TextBlock Margin="3,0"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource DisbaledForegroundBrush}"
                                           Text="{TemplateBinding PlaceText}"
                                           Visibility="{Binding Text.Length,
                                                                Converter={StaticResource EuqalsToVisibilityConverter},
                                                                RelativeSource={RelativeSource TemplatedParent},
                                                                ConverterParameter=0}" />
                                <ScrollViewer x:Name="ContentElement"
                                              Margin="4,0,2,2"
                                              VerticalAlignment="Center"
                                              Background="{x:Null}"
                                              BorderThickness="0"
                                              IsTabStop="False" />
                            </Grid>
                        </Grid>
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource ControlsDisabledBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   Stroke="{StaticResource ControlsDisabledBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="1"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <sys:Boolean>true</sys:Boolean>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Width="12"
                                  Height="12"
                                  Margin="1,-4,-4,0"
                                  HorizontalAlignment="Right"
                                  VerticalAlignment="Top"
                                  Background="Transparent">
                                <Path Margin="1,3,0,0"
                                      Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}" />
                                <Path Margin="1,3,0,0"
                                      Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--  ScrollBar Style  -->
    <Style TargetType="ScrollBar">
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="MinWidth" Value="20" />
        <Setter Property="MinHeight" Value="20" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollBar">
                    <Grid x:Name="Root">
                        <Grid.Resources>
                            <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root" Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverPath" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Blur" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard />
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Path Width="4"
                                          Height="6"
                                          Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                                          Stretch="Uniform">
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource Gray2}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="HoverPath"
                                          Width="4"
                                          Height="6"
                                          Margin="1,1,0,0"
                                          Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="Blur"
                                          Width="4"
                                          Height="6"
                                          Margin="1,1,0,0"
                                          Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Effect>
                                            <BlurEffect />
                                        </Path.Effect>
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                    <Rectangle x:Name="DisabledElement"
                                               Fill="{StaticResource WhiteColorBrush}"
                                               Opacity="0"
                                               RadiusX="2"
                                               RadiusY="2" />
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverPath" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Blur" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard />
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Path Width="4"
                                          Height="6"
                                          Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                                          Stretch="Uniform">
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource Gray2}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="HoverPath"
                                          Width="4"
                                          Height="6"
                                          Margin="0,1,0,0"
                                          Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="Blur"
                                          Width="4"
                                          Height="6"
                                          Margin="0,1,0,0"
                                          Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Effect>
                                            <BlurEffect />
                                        </Path.Effect>
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverPath" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Blur" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard />
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Path Width="6"
                                          Height="4"
                                          Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                                          Stretch="Uniform">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="ButtonColor" Color="{StaticResource Gray3}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="HoverPath"
                                          Width="6"
                                          Height="4"
                                          Margin="1,0,0,0"
                                          Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="Blur"
                                          Width="6"
                                          Height="4"
                                          Margin="1,0,0,0"
                                          Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Effect>
                                            <BlurEffect />
                                        </Path.Effect>
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                    <Rectangle x:Name="DisabledElement"
                                               Fill="{StaticResource WhiteColorBrush}"
                                               Opacity="0"
                                               RadiusX="2"
                                               RadiusY="2" />
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                                <Grid x:Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoverPath" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Blur" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard />
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Rectangle x:Name="Background"
                                               Fill="{StaticResource ControlBackgroundBrush}"
                                               Opacity="0"
                                               RadiusX="2"
                                               RadiusY="2"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="BackgroundMouseOver"
                                               Fill="{StaticResource HighlightBrush}"
                                               Opacity="0"
                                               RadiusX="2"
                                               RadiusY="2" />
                                    <Rectangle x:Name="BackgroundPressed"
                                               Fill="{StaticResource HighlightBrush}"
                                               Opacity="0"
                                               RadiusX="2"
                                               RadiusY="2" />
                                    <Rectangle x:Name="BackgroundGradient"
                                               Margin="1"
                                               Fill="{StaticResource TransparentWhiteBrush}"
                                               Opacity="0"
                                               RadiusX="1"
                                               RadiusY="1"
                                               Stroke="{StaticResource ControlBackgroundBrush}"
                                               StrokeThickness="1" />
                                    <Rectangle x:Name="Highlight"
                                               Margin="1"
                                               IsHitTestVisible="false"
                                               Opacity="0"
                                               RadiusX="1"
                                               RadiusY="1"
                                               Stroke="{StaticResource HighlightBrush}"
                                               StrokeThickness="1" />
                                    <Path Width="6"
                                          Height="4"
                                          Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                                          Stretch="Uniform">
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource Gray2}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="HoverPath"
                                          Width="6"
                                          Height="4"
                                          Margin="1,0,0,0"
                                          Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                    <Path x:Name="Blur"
                                          Width="6"
                                          Height="4"
                                          Margin="1,0,0,0"
                                          Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                                          Opacity="0"
                                          Stretch="Uniform"
                                          UseLayoutRounding="False">
                                        <Path.Effect>
                                            <BlurEffect />
                                        </Path.Effect>
                                        <Path.Fill>
                                            <SolidColorBrush Color="{StaticResource BlackColor}" />
                                        </Path.Fill>
                                    </Path>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                                <Grid>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>

                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0" Value="0" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid x:Name="ThumbVisual" Margin="1,0,1,0">
                                        <Rectangle x:Name="Background"
                                                   Fill="{StaticResource ThumbBrush}"
                                                   StrokeThickness="1" />
                                        <Rectangle x:Name="MouseOverRectangle"
                                                   Fill="{StaticResource BlackBrush}"
                                                   Opacity="0"
                                                   StrokeThickness="1" />
                                        <Rectangle x:Name="PressedRectangle"
                                                   Fill="{StaticResource BlackBrush}"
                                                   Opacity="0"
                                                   StrokeThickness="1" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                                <Grid>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity">
                                                        <SplineDoubleKeyFrame KeyTime="0:0:0" Value="0" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid x:Name="ThumbVisual" Margin="0,1,0,1">
                                        <Rectangle x:Name="Background"
                                                   Fill="{StaticResource ThumbBrush}"
                                                   StrokeThickness="1" />
                                        <Rectangle x:Name="MouseOverRectangle"
                                                   Fill="{StaticResource BlackBrush}"
                                                   Opacity="0"
                                                   StrokeThickness="1" />
                                        <Rectangle x:Name="PressedRectangle"
                                                   Fill="{StaticResource BlackBrush}"
                                                   Opacity="0"
                                                   StrokeThickness="1" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="HorizontalRoot" Height="11">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Border Grid.RowSpan="1"
                                    Grid.ColumnSpan="5"
                                    Margin="0,0,0,-1"
                                    BorderThickness="0,0,0,1"
                                    Visibility="Collapsed">
                                <Border.BorderBrush>
                                    <SolidColorBrush Color="{StaticResource Gray4}" />
                                </Border.BorderBrush>
                            </Border>
                            <RepeatButton x:Name="HorizontalSmallDecrease"
                                          Grid.Column="0"
                                          Width="16"
                                          Margin="1"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource HorizontalDecrementTemplate}" />
                            <RepeatButton x:Name="HorizontalLargeDecrease"
                                          Grid.Column="1"
                                          Width="0"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <Thumb x:Name="HorizontalThumb"
                                   Grid.Column="2"
                                   Width="18"
                                   MinWidth="18"
                                   Background="{TemplateBinding Background}"
                                   Template="{StaticResource HorizontalThumbTemplate}" />
                            <RepeatButton x:Name="HorizontalLargeIncrease"
                                          Grid.Column="3"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <RepeatButton x:Name="HorizontalSmallIncrease"
                                          Grid.Column="4"
                                          Width="16"
                                          Margin="1"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource HorizontalIncrementTemplate}" />
                        </Grid>
                        <Grid x:Name="VerticalRoot"
                              Width="11"
                              Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Border Grid.RowSpan="5"
                                    Margin="0,0,-1,0"
                                    BorderThickness="0,0,1,0"
                                    Visibility="Collapsed">
                                <Border.BorderBrush>
                                    <SolidColorBrush Color="{StaticResource Gray4}" />
                                </Border.BorderBrush>
                            </Border>
                            <RepeatButton x:Name="VerticalSmallDecrease"
                                          Grid.Row="0"
                                          Height="16"
                                          Margin="1"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource VerticalDecrementTemplate}" />
                            <RepeatButton x:Name="VerticalLargeDecrease"
                                          Grid.Row="1"
                                          Height="0"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <Thumb x:Name="VerticalThumb"
                                   Grid.Row="2"
                                   Height="18"
                                   MinHeight="18"
                                   Template="{StaticResource VerticalThumbTemplate}" />
                            <RepeatButton x:Name="VerticalLargeIncrease"
                                          Grid.Row="3"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <RepeatButton x:Name="VerticalSmallIncrease"
                                          Grid.Row="4"
                                          Height="16"
                                          Margin="1"
                                          Interval="50"
                                          IsTabStop="False"
                                          Template="{StaticResource VerticalIncrementTemplate}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  ScrollViewer Style  -->
    <Style TargetType="ScrollViewer">
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="VerticalScrollBarVisibility" Value="Visible" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Gray4}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ScrollContentPresenter x:Name="ScrollContentPresenter"
                                                    Margin="{TemplateBinding Padding}"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                                    Cursor="{TemplateBinding Cursor}" />
                            <Rectangle Grid.Row="1"
                                       Grid.Column="1"
                                       Visibility="Collapsed" />
                            <ScrollBar x:Name="VerticalScrollBar"
                                       Grid.Row="0"
                                       Grid.Column="1"
                                       Width="18"
                                       Margin="0,-1,-3,-1"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableHeight}"
                                       Minimum="0"
                                       Orientation="Vertical"
                                       ViewportSize="{TemplateBinding ViewportHeight}"
                                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                       Value="{TemplateBinding VerticalOffset}" />
                            <ScrollBar x:Name="HorizontalScrollBar"
                                       Grid.Row="1"
                                       Grid.Column="0"
                                       Height="18"
                                       Margin="-1,0,-1,-3"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableWidth}"
                                       Minimum="0"
                                       Orientation="Horizontal"
                                       ViewportSize="{TemplateBinding ViewportWidth}"
                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                       Value="{TemplateBinding HorizontalOffset}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  ToggleButton Style  -->
    <Style TargetType="ToggleButton">
        <Setter Property="Background" Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="Padding" Value="5,6" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckedInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource WhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3" />
                        <Border x:Name="MouseOverBorder"
                                Background="{StaticResource GrayBrush8}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="PressedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="CheckedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Rectangle x:Name="FocusRectangle"
                                   Margin="-1"
                                   Opacity="0"
                                   RadiusX="4"
                                   RadiusY="4"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="CheckedRectangle"
                                   Margin="-1"
                                   Opacity="0"
                                   RadiusX="4"
                                   RadiusY="4"
                                   Stroke="{StaticResource GrayBrush1}" />
                        <Rectangle x:Name="CheckedInnerRectangle"
                                   Fill="{StaticResource GrayBrush2}"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Stroke="{StaticResource GrayBrush2}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <ContentPresenter x:Name="contentPresenter"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  Tooltip Style  -->
    <Style TargetType="ToolTip">
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource WhiteBrush}" />
        <Setter Property="Padding" Value="3,0,3,0" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="{StaticResource ItemSelectedBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolTip">
                    <Border x:Name="Root"
                            Background="{StaticResource BlackBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Effect="{StaticResource DropShadowBrush}"
                            Opacity="0">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="OpenStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="Open"
                                                      GeneratedDuration="0:0:0.3"
                                                      To="Closed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Closed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Padding="{TemplateBinding Padding}">
                            <Border.Resources>
                                <Storyboard x:Key="Visible State" />
                                <Storyboard x:Key="Normal State" />
                            </Border.Resources>
                            <Border.Background>
                                <StaticResource ResourceKey="BlackBrush" />
                            </Border.Background>
                            <ContentPresenter Margin="{TemplateBinding Padding}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Cursor="{TemplateBinding Cursor}" />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  RepeatButton Style  -->
    <Style TargetType="RepeatButton">
        <Setter Property="Background" Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="Padding" Value="5,6" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusInnerRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3" />
                        <Border x:Name="MouseOverBorder"
                                Background="{StaticResource GrayBrush8}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="PressedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Rectangle x:Name="FocusRectangle"
                                   Margin="-1"
                                   Opacity="0"
                                   RadiusX="4"
                                   RadiusY="4"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Opacity="0"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}" />
                        <ContentPresenter x:Name="contentPresenter"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  RadioButton Style  -->
    <Style TargetType="RadioButton">
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="Background" Value="{StaticResource CheckBoxBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Padding" Value="4,1,0,0" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="{StaticResource CheckBoxBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RadioButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverEllipse" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor" Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Gray2}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Grid x:Name="grid"
                                  Width="15"
                                  Height="15"
                                  Opacity="0.7">
                                <Ellipse x:Name="Background"
                                         Margin="1"
                                         Fill="{TemplateBinding Background}"
                                         Stroke="{TemplateBinding BorderBrush}"
                                         StrokeThickness="{TemplateBinding BorderThickness}" />
                                <Ellipse x:Name="MouseOverEllipse"
                                         Margin="1"
                                         Opacity="0"
                                         Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                                <Ellipse x:Name="PressedEllipse"
                                         Margin="1"
                                         Opacity="0"
                                         Stroke="{StaticResource BlackBrush}" />
                                <Ellipse x:Name="CheckIcon"
                                         Width="7"
                                         Height="7"
                                         Fill="{StaticResource BlackBrush}"
                                         Opacity="0" />
                                <Ellipse x:Name="DisabledVisualElement"
                                         Fill="{StaticResource DisabledWhiteColorBrush}"
                                         Opacity="0" />
                                <Grid x:Name="ValidationErrorElement"
                                      ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                      Visibility="Collapsed">
                                    <ToolTipService.ToolTip>
                                        <ToolTip x:Name="validationTooltip"
                                                 DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                 Placement="Right"
                                                 PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                 Template="{StaticResource ValidationToolTipTemplate}">
                                            <ToolTip.Triggers>
                                                <EventTrigger RoutedEvent="Canvas.Loaded">
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <sys:Boolean>true</sys:Boolean>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </EventTrigger>
                                            </ToolTip.Triggers>
                                        </ToolTip>
                                    </ToolTipService.ToolTip>
                                    <Ellipse Width="14"
                                             Height="14"
                                             Stroke="{StaticResource ControlsValidationBrush}"
                                             StrokeThickness="1" />
                                    <Ellipse Width="4"
                                             Height="4"
                                             Margin="0,-2,-1,0"
                                             HorizontalAlignment="Right"
                                             VerticalAlignment="Top"
                                             Fill="{StaticResource ControlsValidationBrush}" />
                                    <Ellipse Width="10"
                                             Height="10"
                                             Margin="0,-5,-4,0"
                                             HorizontalAlignment="Right"
                                             VerticalAlignment="Top"
                                             Fill="Transparent" />
                                </Grid>
                            </Grid>
                        </Grid>
                        <ContentControl Grid.Column="1">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor" Color="{StaticResource BlackColor}" />
                            </ContentControl.Foreground>
                            <ContentPresenter x:Name="contentPresenter"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </ContentControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  ProgressBar Style  -->
    <Style TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Background" Value="{StaticResource GrayBrush4}" />
        <Setter Property="Maximum" Value="100" />
        <Setter Property="Height" Value="10" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProgressBar">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Determinate" />
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard RepeatBehavior="Forever">
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00"
                                                                       Storyboard.TargetName="IndeterminateRoot"
                                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00"
                                                                       Storyboard.TargetName="DeterminateRoot"
                                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateGradientFill" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.Transform).(TransformGroup.Children)[0].X">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:.35" Value="20" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ProgressBarTrack"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" />
                        <Grid x:Name="ProgressBarRootGrid">
                            <Grid x:Name="IndeterminateRoot" Visibility="Collapsed">
                                <Rectangle x:Name="IndeterminateSolidFill"
                                           Margin="{TemplateBinding BorderThickness}"
                                           Fill="{StaticResource BrandingBrush}"
                                           Opacity="1"
                                           RenderTransformOrigin="0.5,0.5"
                                           StrokeThickness="0" />
                                <Rectangle x:Name="IndeterminateGradientFill"
                                           Margin="{TemplateBinding BorderThickness}"
                                           Opacity="0.7"
                                           StrokeThickness="1">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush MappingMode="Absolute" SpreadMethod="Repeat" StartPoint="20,1" EndPoint="0,1">
                                            <LinearGradientBrush.Transform>
                                                <TransformGroup>
                                                    <TranslateTransform X="0" />
                                                    <SkewTransform AngleX="-30" />
                                                </TransformGroup>
                                            </LinearGradientBrush.Transform>
                                            <GradientStop Offset="0" Color="{StaticResource ProgressIndeterminateColor1}" />
                                            <GradientStop Offset="0.651" Color="{StaticResource ProgressIndeterminateColor2}" />
                                            <GradientStop Offset="0.093" Color="{StaticResource ProgressIndeterminateColor3}" />
                                            <GradientStop Offset="0.548" Color="{StaticResource ProgressIndeterminateColor4}" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                            <Grid x:Name="DeterminateRoot" Margin="1">
                                <Border x:Name="ProgressBarIndicator"
                                        Margin="-1"
                                        HorizontalAlignment="Left"
                                        Background="{StaticResource BrandingBrush}">
                                    <Rectangle x:Name="GradientFill"
                                               Opacity="0.7"
                                               Visibility="Collapsed">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush MappingMode="Absolute" SpreadMethod="Repeat" StartPoint="20,1" EndPoint="0,1">
                                                <LinearGradientBrush.Transform>
                                                    <TransformGroup>
                                                        <TranslateTransform X="0" />
                                                        <SkewTransform AngleX="-30" />
                                                    </TransformGroup>
                                                </LinearGradientBrush.Transform>
                                                <GradientStop Offset="0" Color="{StaticResource ProgressIndeterminateColor1}" />
                                                <GradientStop Offset="0.651" Color="{StaticResource ProgressIndeterminateColor2}" />
                                                <GradientStop Offset="0.093" Color="{StaticResource ProgressIndeterminateColor3}" />
                                                <GradientStop Offset="0.548" Color="{StaticResource ProgressIndeterminateColor4}" />
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Border>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1" />
    </Style>

    <!--  CheckBox Style  -->
    <Style TargetType="CheckBox">
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="Background" Value="{StaticResource CheckBoxBackgroundBrush}" />
        <Setter Property="MinWidth" Value="100" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="4,1,0,0" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="{StaticResource CheckBoxBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor" Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource Gray2}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateIcon" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                            <Grid x:Name="grid"
                                  Width="14"
                                  Height="14"
                                  Opacity="0.7">
                                <Rectangle x:Name="Background"
                                           Fill="{TemplateBinding Background}"
                                           Stroke="{TemplateBinding BorderBrush}"
                                           StrokeThickness="{TemplateBinding BorderThickness}" />
                                <Rectangle x:Name="MouseOverRectangle"
                                           Opacity="0"
                                           Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                                <Rectangle x:Name="PressedRectangle"
                                           Opacity="0"
                                           Stroke="{StaticResource BlackBrush}" />
                                <Path x:Name="CheckIcon"
                                      Width="8.9"
                                      Height="7.6"
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center"
                                      Data="M49.4375,110.4375 L51.4995,112.812 L56.3745,107.24883"
                                      Opacity="0"
                                      Stretch="Fill"
                                      Stroke="Black"
                                      StrokeEndLineCap="Triangle"
                                      StrokeStartLineCap="Triangle"
                                      StrokeThickness="2"
                                      UseLayoutRounding="False" />
                                <Rectangle x:Name="IndeterminateIcon"
                                           Width="8"
                                           Height="8"
                                           Opacity="0">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{StaticResource Gray3}" />
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle x:Name="DisabledVisualElement"
                                           Fill="{StaticResource DisabledWhiteColorBrush}"
                                           Opacity="0"
                                           RadiusX="1"
                                           RadiusY="1" />
                            </Grid>
                            <Border x:Name="ValidationErrorElement"
                                    Margin="1"
                                    BorderBrush="{StaticResource ControlsValidationBrush}"
                                    BorderThickness="1"
                                    CornerRadius="1"
                                    ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                    Visibility="Collapsed">
                                <ToolTipService.ToolTip>
                                    <ToolTip x:Name="validationTooltip"
                                             DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                             Placement="Right"
                                             PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                             Template="{StaticResource ValidationToolTipTemplate}">
                                        <ToolTip.Triggers>
                                            <EventTrigger RoutedEvent="Canvas.Loaded">
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                                <DiscreteObjectKeyFrame.Value>
                                                                    <sys:Boolean>true</sys:Boolean>
                                                                </DiscreteObjectKeyFrame.Value>
                                                            </DiscreteObjectKeyFrame>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </EventTrigger>
                                        </ToolTip.Triggers>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                                <Grid Width="10"
                                      Height="10"
                                      Margin="0,-4,-4,0"
                                      HorizontalAlignment="Right"
                                      VerticalAlignment="Top"
                                      Background="Transparent">
                                    <Path Margin="0,3,0,0"
                                          Data="M 1,0 L5,0 A 2,2 90 0 1 7,2 L7,6 z"
                                          Fill="{StaticResource ValidationBrush5}" />
                                    <Path Margin="0,3,0,0"
                                          Data="M 0,0 L2,0 L 7,5 L7,7"
                                          Fill="{StaticResource WhiteColorBrush}" />
                                </Grid>
                            </Border>
                        </Grid>
                        <ContentControl Grid.Column="1">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor" Color="{StaticResource BlackColor}" />
                            </ContentControl.Foreground>
                            <ContentPresenter x:Name="contentPresenter"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </ContentControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  ListBoxItem Style  -->
    <Style TargetType="ListBoxItem">
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="Padding" Value="10" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="TabNavigation" Value="Local" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="fillColor"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To=".55" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="contentControl"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        To="{StaticResource HoverForegroundColor}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="contentPresenter"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To=".55" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="contentControl"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        To="{StaticResource HoverForegroundColor}" />
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="fillColor"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedUnfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="FocusVisualElement"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="fillColor2"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="1" />
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="contentControl"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        To="{StaticResource HoverForegroundColor}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="fillColor"
                                   Fill="{StaticResource HighlightBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   RadiusX="1"
                                   RadiusY="1" />
                        <Rectangle x:Name="fillColor2"
                                   Fill="{StaticResource HighlightBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   RadiusX="1"
                                   RadiusY="1" />
                        <ContentControl x:Name="contentControl">
                            <ContentPresenter x:Name="contentPresenter"
                                              Margin="7"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="Center"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </ContentControl>
                        <Rectangle x:Name="FocusVisualElement"
                                   RadiusX="1"
                                   RadiusY="1"
                                   Stroke="{StaticResource HighlightBrush}"
                                   StrokeThickness="1"
                                   Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  ListBox Style  -->
    <Style TargetType="ListBox">
        <Setter Property="Padding" Value="1" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="TabNavigation" Value="Once" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="BorderBrush" Value="{StaticResource ThumbBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <ScrollViewer x:Name="ScrollViewer"
                                          Background="{TemplateBinding Background}"
                                          BorderBrush="Transparent"
                                          BorderThickness="0"
                                          Padding="{TemplateBinding Padding}"
                                          TabNavigation="{TemplateBinding TabNavigation}">
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Border>
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="2"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <sys:Boolean>true</sys:Boolean>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Width="10"
                                  Height="10"
                                  Margin="0,-4,-4,0"
                                  HorizontalAlignment="Right"
                                  VerticalAlignment="Top"
                                  Background="Transparent">
                                <Path Margin="-1,3,0,0"
                                      Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}" />
                                <Path Margin="-1,3,0,0"
                                      Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="0" />
    </Style>

    <!--  Slider Style  -->
    <Style x:Key="HorizontalSliderThumb" TargetType="Thumb">
        <Setter Property="Background" Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{StaticResource BlackBrush}"
                                BorderBrush="{StaticResource ControlBackgroundBrush}"
                                BorderThickness="0,0,1,0" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  VerticalSliderThumb  -->
    <Style x:Key="VerticalSliderThumb" TargetType="Thumb">
        <Setter Property="Background" Value="{StaticResource TransparentWhiteBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{StaticResource BlackBrush}"
                                BorderBrush="{StaticResource ControlBackgroundBrush}"
                                BorderThickness="0,1,0,0" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--  RepeatButtonTemplate  -->
    <ControlTemplate x:Key="RepeatButtonTemplate">
        <Grid x:Name="Root" Opacity="0" />
    </ControlTemplate>
    <!--  HorizontalTrackLargeDecrease  -->
    <ControlTemplate x:Key="HorizontalTrackLargeDecrease" TargetType="RepeatButton">
        <Grid x:Name="Root" Margin="0,-1,0,0">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                    <VisualState x:Name="Pressed" />
                    <VisualState x:Name="Disabled" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle Height="3" Margin="0,1,0,0">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource BlackColor}" />
                </Rectangle.Fill>
            </Rectangle>
        </Grid>
    </ControlTemplate>
    <!--  VerticalTrackLargeDecrease  -->
    <ControlTemplate x:Key="VerticalTrackLargeDecrease" TargetType="RepeatButton">
        <Grid x:Name="Root" Margin="0,0,0,0">
            <Rectangle Width="3">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource BlackColor}" />
                </Rectangle.Fill>
            </Rectangle>
        </Grid>
    </ControlTemplate>

    <!--  Slider Style  -->
    <Style TargetType="Slider">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Maximum" Value="10" />
        <Setter Property="Minimum" Value="0" />
        <Setter Property="Value" Value="0" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Slider">
                    <Grid x:Name="Root">
                        <Grid.Resources>
                            <ControlTemplate x:Key="RepeatButtonTemplate">
                                <Grid x:Name="Root" Opacity="0" />
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="HorizontalTrackRectangleDisabledOverlay"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="ThumbDisabledOverlay"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetName="VerticalTrackRectangleDisabledOverlay"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ThumbDisabledOverlayVertical" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRectangleDisabledOverlay_Copy" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRectangleDisabledOverlay_Copy" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="HorizontalTemplate" Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Rectangle x:Name="TrackRectangle"
                                       Grid.Column="0"
                                       Grid.ColumnSpan="3"
                                       Height="3"
                                       Margin="5,0"
                                       Fill="{StaticResource SliderTrackBrush}"
                                       StrokeThickness="{TemplateBinding BorderThickness}" />
                            <Rectangle x:Name="HorizontalTrackRectangleDisabledOverlay"
                                       Grid.Column="0"
                                       Grid.ColumnSpan="3"
                                       Height="3"
                                       Margin="5,0,5,0"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Opacity=".55"
                                       Visibility="Collapsed" />
                            <RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton"
                                          Grid.Column="0"
                                          Height="18"
                                          IsTabStop="False"
                                          Template="{StaticResource HorizontalTrackLargeDecrease}" />
                            <Rectangle x:Name="HorizontalTrackRectangleDisabledOverlay_Copy"
                                       Grid.ColumnSpan="1"
                                       Height="4"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Opacity="0.7"
                                       Visibility="Collapsed" />
                            <Thumb x:Name="HorizontalThumb"
                                   Grid.Column="1"
                                   Width="4"
                                   Height="10"
                                   IsTabStop="True"
                                   Style="{StaticResource HorizontalSliderThumb}" />
                            <Rectangle x:Name="ThumbDisabledOverlay"
                                       Grid.Column="1"
                                       Width="4"
                                       Height="10"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Opacity="0.25"
                                       Visibility="Collapsed" />
                            <RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton"
                                          Grid.Column="2"
                                          Height="18"
                                          IsTabStop="False"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                        </Grid>
                        <Grid x:Name="VerticalTemplate" Background="{TemplateBinding Background}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Rectangle x:Name="TrackRectangle_Vertical"
                                       Grid.Row="0"
                                       Grid.RowSpan="3"
                                       Grid.ColumnSpan="1"
                                       Width="3"
                                       Margin="0,5"
                                       Fill="{StaticResource SliderTrackBrush}"
                                       StrokeThickness="{TemplateBinding BorderThickness}" />
                            <Rectangle x:Name="VerticalTrackRectangleDisabledOverlay"
                                       Grid.Row="0"
                                       Grid.RowSpan="3"
                                       Width="3"
                                       Margin="0,5,0,5"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Opacity=".55"
                                       Visibility="Collapsed" />
                            <RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton"
                                          Grid.Row="2"
                                          Width="17"
                                          IsTabStop="False"
                                          Template="{StaticResource VerticalTrackLargeDecrease}" />
                            <Rectangle x:Name="VerticalTrackRectangleDisabledOverlay_Copy"
                                       Grid.Row="2"
                                       Grid.RowSpan="1"
                                       Width="5"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Opacity="0.7"
                                       Visibility="Collapsed" />
                            <Thumb x:Name="VerticalThumb"
                                   Grid.Row="1"
                                   Width="10"
                                   Height="4"
                                   IsTabStop="True"
                                   Style="{StaticResource VerticalSliderThumb}" />
                            <RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton"
                                          Grid.Row="0"
                                          Width="17"
                                          IsTabStop="False"
                                          Template="{StaticResource RepeatButtonTemplate}" />
                            <Rectangle x:Name="ThumbDisabledOverlayVertical"
                                       Grid.Row="1"
                                       Width="10"
                                       Height="4"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Opacity="0.25"
                                       Visibility="Collapsed" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
    </Style>


</ResourceDictionary>
